package com.hsgene.order.condition;

import com.hsgene.common.util.date.SimpleDateUtils;
import com.hsgene.common.util.date.TimeJsonDeserializer;
import org.apache.commons.lang.StringUtils;

import java.util.Date;

/**
 * 花生仁地服-订单查询条件
 *
 * @author wangbing
 * @version 1.0, 2018/9/18
 */
public class GeneticTestingOrderCondition {

    /**
     * 花生仁地服id
     */
    private String groundServantId;

    /**
     * 页码检测单前端分类
     */
    private String listType;

    /**
     * 指定订单状态（多个状态之间用','分隔）
     */
    private String status;

    /**
     * 关键词(匹配 订单编号，患者姓名，用户姓名[医生姓名])
     */
    private String keywords;

    /**
     * 医生姓名
     */
    private String doctorName;

    /**
     * 是否上传dcw(1是已上传，0是未上传)
     */
    private String hasDcw;

    /**
     * 按下单日期搜索开始日期
     */
    private Date startDate;

    /**
     * 按下单日期搜索结束日期
     */
    private Date endDate;

    /**
     * 付款类型(0：患者本人支付，1：地服代付)
     */
    private String payerType;

    /**
     * 关键词2（匹配 患者姓名或患者联系电话）
     */
    private String keywords2;

    /**
     * 医生id
     */
    private String doctorId;

    /**
     * 是否删除0-未删除，1-已删除
     */
    private Integer deleteFlag;

    public String getGroundServantId() {
        return groundServantId;
    }

    public void setGroundServantId(String groundServantId) {
        this.groundServantId = groundServantId;
    }

    public String getListType() {
        return listType;
    }

    public void setListType(String listType) {
        this.listType = listType;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getKeywords() {
        return keywords;
    }

    public void setKeywords(String keywords) {
        this.keywords = keywords;
    }

    public String getDoctorName() {
        return doctorName;
    }

    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }

    public String getHasDcw() {
        return hasDcw;
    }

    public void setHasDcw(String hasDcw) {
        this.hasDcw = hasDcw;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public void setStartDate(String startDateStr) {
        if (StringUtils.isNotBlank(startDateStr)) {
            if (TimeJsonDeserializer.matchStandardPattern(startDateStr)) {
                this.startDate = SimpleDateUtils.parseDate(startDateStr, SimpleDateUtils.DatePattern.STANDARD_PATTERN
                        .toString());
            } else {
                this.startDate = SimpleDateUtils.parseDate(startDateStr, SimpleDateUtils.DatePattern.YYYY_MM_DD.toString
                        (), SimpleDateUtils.HourMinSecondFormat.MID_NIGHT);
            }
        }
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public void setEndDate(String endDateStr) {
        if (StringUtils.isNotBlank(endDateStr)) {
            if (TimeJsonDeserializer.matchStandardPattern(endDateStr)) {
                this.endDate = SimpleDateUtils.parseDate(endDateStr, SimpleDateUtils.DatePattern.STANDARD_PATTERN
                        .toString());
            } else {
                this.endDate = SimpleDateUtils.parseDate(endDateStr, SimpleDateUtils.DatePattern.YYYY_MM_DD.toString(),
                        SimpleDateUtils.HourMinSecondFormat.TODAY_END);
            }
        }
    }

    public String getPayerType() {
        return payerType;
    }

    public void setPayerType(String payerType) {
        this.payerType = payerType;
    }

    public String getKeywords2() {
        return keywords2;
    }

    public void setKeywords2(String keywords2) {
        this.keywords2 = keywords2;
    }

    public String getDoctorId() {
        return doctorId;
    }

    public void setDoctorId(String doctorId) {
        this.doctorId = doctorId;
    }

    public Integer getDeleteFlag() {
        return deleteFlag;
    }

    public void setDeleteFlag(Integer deleteFlag) {
        this.deleteFlag = deleteFlag;
    }
}
